<script>
init({
  title: 'Search Highlight',
  desc: 'Use `searchHighlight` to highlight the searched text (using the `<mark>` html tag).',
  links: ['bootstrap-table.min.css'],
  scripts: ['bootstrap-table.min.js']
})
</script>

<template>
  <table
    id="table"
    data-toggle="table"
    data-search="true"
    data-search-highlight="true"
    data-url="json/data1.json"
  >
    <thead>
      <tr>
        <th data-field="id">
          ID
        </th>
        <th data-field="name">
          Item Name
        </th>
        <th
          data-field="price"
          data-formatter="priceFormatter"
        >
          Item Price
        </th>
      </tr>
    </thead>
  </table>
</template>

<script>
  window.priceFormatter = (value, row) => `<span>${value}</span>
    <span style="margin-left: 5px">(${row.name})</span>`
</script>
